package com.hgw.Demo02_adapterPattern.Exercises9_9_6;

/**
 * Data time:2021/12/14 11:36
 * StudentID:2019112118
 * Author:hgw
 * Description: Adapter 适配器
 */
public class Adapter implements Cat,Dog{
    private Cat cat;
    private Dog dog;

    public Adapter(Cat cat) {
        this.cat = cat;
    }

    public Adapter(Dog dog) {
        this.dog = dog;
    }

    @Override
    public void catchMouse() {
        dog.ctr();
    }

    @Override
    public void ctr() {
        cat.catchMouse();
    }
}